﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace ModernShopping.AppCode
{
    public class LoginInfo
    {
        public Guid UserID { get; set; }
        public string ImageURL { get; set; }
        public string CompanyName { get; set; }
        public string Role { get; set; }
        public LoginInfo(Guid UserID)
        {
            this.UserID = UserID;
            Company company = DbCompany.getCompany(UserID);
            this.ImageURL = company.Logo;
            this.CompanyName = company.Name;
            this.Role = DbAccount.GetRole(UserID);
        }

        public bool IsAdmin()
        {
            return Role.Equals(DbAccount.ADMIN);
        }
        public bool IsUser()
        {
            return Role.Equals(DbAccount.USER);
        }
        public bool IsGuess()
        {
            return Role.Equals(DbAccount.GUESS);
        }
    }
}